<!--********************************************************************
* Copyright© 2000 - 2018 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title data-i18n="resources.title_mousestyle"></title>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" include="bootstrap,widgets.alert" src="../js/include-web.js"></script>
<script type="text/javascript" exclude="iclient-classic" src="../../dist/classic/include-classic.js"></script>
<script type="text/javascript">
    var map, layer, vector,
        host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090",
        url = host + "/iserver/services/map-world/rest/maps/World";

    var broz = SuperMap.Util.getBrowser();
    if (broz.device === 'android' || broz.device === 'apple') {
        widgets.alert.showAlert(resources.msg_supportEquipment,false);
    }
    map = new SuperMap.Map("map", {
        controls: [
            new SuperMap.Control.Zoom(),
            new SuperMap.Control.Navigation(),
            new SuperMap.Control.LayerSwitcher()
        ]
    });
    layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, null, {maxResolution: "auto"});
    layer.events.on({"layerInitialized": addLayer});
    vector = new SuperMap.Layer.Vector("vectorLayer");
    addData();

    function addLayer() {

        map.addLayers([layer, vector]);
        //显示地图范围
        map.setCenter(new SuperMap.LonLat(0, 0), 0);
        openInfoWin();
    }

    function addData() {
        var point = new SuperMap.Geometry.Point(0, 0);
        var pointlayer = new SuperMap.Feature.Vector(point);
        pointlayer.style = {
            fillColor: "#FF00FF",
            strokeColor: "yellow",
            pointRadius: 28
        };
        var point1 = new SuperMap.Geometry.Point(100, 39.3);
        var pointlayer1 = new SuperMap.Feature.Vector(point1);
        pointlayer1.style = {
            cursor: "auto",
            fillColor: "#FF00FF",
            strokeColor: "yellow",
            pointRadius: 28
        };

        var point2 = new SuperMap.Geometry.Point(-100, -39.3);
        var pointlayer2 = new SuperMap.Feature.Vector(point2);
        pointlayer2.style = {
            cursor: "crosshair",
            fillColor: "#FF00FF",
            strokeColor: "yellow",
            pointRadius: 28
        };
        vector.addFeatures([pointlayer, pointlayer1, pointlayer2]);
    }

    function openInfoWin() {
        var popup = new SuperMap.Popup.FramedCloud("popwin",
            new SuperMap.LonLat(0, 0),
            null,
            resources.text_handMouse,
            null,
            false);
        infowin = popup;
        map.addPopup(popup);
        var popup1 = new SuperMap.Popup.FramedCloud("popwin",
            new SuperMap.LonLat(-100, -39.3),
            null,
            resources.text_crossMouse,
            null,
            false);
        infowin1 = popup1;
        map.addPopup(popup1);
        var popup2 = new SuperMap.Popup.FramedCloud("popwin",
            new SuperMap.LonLat(100, 39.3),
            null,
            resources.text_defaultMouse,
            null,
            false);
        infowin2 = popup2;
        map.addPopup(popup2);
    }
</script>
</body>
</html>